﻿
namespace Marmat.Forms.Views
{
    namespace GridControl
    {
        public class ValidateEditEventArgs : GridEventArgs
        {
            private Grid.ValidateEditEventArgs _args;

            public ValidateEditEventArgs(Forms.GridControl gridControl, Grid.ValidateEditEventArgs args) : base(gridControl)
            {
                this._args = args;
            }

            public Grid.Column Column
            {
                get
                {
                    return this._args.Column;
                }
            }

            private Grid.Column _Column;

            public object Row
            {
                get
                {
                    return this._args.Row;
                }
            }

            private object _Row;

            public object Value
            {
                get
                {
                    return this._args.Value;
                }

                set
                {
                    this._args.Value = value;
                }
            }

            /// <summary>
            /// 获取或设置错误说明
            /// </summary>
            /// <value></value>
            /// <returns></returns>
            /// <remarks></remarks>
            public string ErrorText
            {
                get
                {
                    return this._args.ErrorText;
                }

                set
                {
                    this._args.ErrorText = value;
                }
            }

            /// <summary>
            /// 逻辑型，设为True表示无法通过验证，禁止退出编辑模式。
            /// </summary>
            /// <value></value>
            /// <returns></returns>
            /// <remarks></remarks>
            public new bool Cancel
            {
                get
                {
                    return !this._args.Cancel;
                }

                set
                {
                    this._args.Cancel = value;
                }
            }
        }
    }
}